﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace PROSHOP.DAL
{
    public class ChungLoaiDAL
    {
        ProshopDataContext proshop;

        public ChungLoaiDAL()
        {
            proshop = new ProshopDataContext();
        }

        public DataSet ctChungLoai(int maCL)
        {
            var s = from cl in proshop.ChungLoais
                    where cl.MaChungLoai == maCL
                    select new
                    {
                        cl.MaChungLoai,
                        cl.TenChungLoai

                    };
            SqlCommand cmd = (SqlCommand)proshop.GetCommand(s);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
            return ds;
        }
    }
}